Skip to main content

1.5.2 Save command window work sessions as a script

Work already performed in the command window can easily be transferred into a script for further editing. This can be done in four ways:

  • In the script window there is a menu button at the top left. There you can select "Nytt skript med historikk fra kommandolinjen" ("New script with command line history"). Remember to enter a name for the script in the line above the script window. The script will then be saved with this name.

  • Use the command history in the command window. This returns a chronological list of all commands run, which can be copied into the script window by clicking on the copy button that will appear when holding the mouse cursor over, and then using the CTRL + C keyboard combination. Remember to create a name for the script also in this case.

  • In the command window, you can type the save command followed by an optional name that you use on the script. The name must have quotation marks around (both single and double quotation marks are allowed), for example save 'Analysis of the unemployed'. With this procedure, you do not need to name the script in the script window afterwards.

  • Instead of using save, you may use the edit command. This is similar save in that your work in the command window is automatically entered into the existing / active script in the script window. But be aware that the existing script is overwritten with the new content. This command is useful when you want to run a script where you send the result to the command window (see section 1.5.3), and then test it out and add new commands there. Edit then makes sure that your new commands are easily added to the script you ran.